<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
</head>
<body>
<input type="button" value="获取数据" id="btn">
<script>
    $(function () {
        $("#btn").on('click',function () {
            $.ajax({
                url:'./data.json',
                type:'get',
                dataType:'json',
                // success:function (data) {
                //     console.log(data)
                // }
            })
                .then(function (data) {
                    console.log(data)
                })
        })
    })
</script>
</body>
</html>